package org.semanticflash.rdf.graph
{
	import com.bigflexlib.ds.container.zet.IOSet;
	
	import org.semanticflash.rdf.graph.index.RDFTripleIndex;
	import org.semanticflash.rdf.graph.redirection.provider.RDFRedirectedIndexedTripleProvider;
	import org.semanticflash.rdf.triple.IRDFIndexedTripleProvider;
	import org.semanticflash.rdf.triple.RDFTriple;





	/**
	 * 
	 * 
	 * A graph with indexation and redirected views
	 * 
	 * @author aldo.bucchi@gmail.com
	 * 
	 */
	public class RDFIndexedGraph extends RDFGraph implements IRDFIndexedTripleProvider
	{
		
		
		private var index:RDFTripleIndex;
		
		
		private var prov:IRDFIndexedTripleProvider;
		
		

		public function RDFIndexedGraph( iriCompareFunction:Function = null ) 
		{
			
			super(  iriCompareFunction );

			index = new RDFTripleIndex( triples );
			
			prov = new RDFRedirectedIndexedTripleProvider( index, redirectionContext );
			
		}

		
		
		public function getTriples( mask:RDFTriple ):IOSet
		{
			return prov.getTriples( mask );
		}
		
	}
}